using System;

namespace DnsService.Events
{
    /// <summary>
    /// 日志消息事件参数
    /// 作者：huobing
    /// </summary>
    public class LogMessageEventArgs : EventArgs
    {
        /// <summary>
        /// 日志消息
        /// </summary>
        public string Message { get; }
        
        /// <summary>
        /// 日志级别
        /// </summary>
        public string Level { get; }
        
        /// <summary>
        /// 日志时间
        /// </summary>
        public DateTime LogTime { get; }
        
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="message">日志消息</param>
        /// <param name="level">日志级别</param>
        public LogMessageEventArgs(string message, string level = "INFO")
        {
            Message = message;
            Level = level;
            LogTime = DateTime.Now;
        }
    }
    
    /// <summary>
    /// 服务状态事件参数
    /// 作者：huobing
    /// </summary>
    public class ServiceStatusEventArgs : EventArgs
    {
        /// <summary>
        /// 状态消息
        /// </summary>
        public string Message { get; }
        
        /// <summary>
        /// 状态
        /// </summary>
        public string Status { get; }
        
        /// <summary>
        /// 是否成功
        /// </summary>
        public bool IsSuccess { get; }
        
        /// <summary>
        /// 状态时间
        /// </summary>
        public DateTime StatusTime { get; }
        
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="message">状态消息</param>
        /// <param name="status">状态</param>
        /// <param name="isSuccess">是否成功</param>
        public ServiceStatusEventArgs(string message, string status, bool isSuccess)
        {
            Message = message;
            Status = status;
            IsSuccess = isSuccess;
            StatusTime = DateTime.Now;
        }
    }
}